package com.LA_houseLease.app.controller.apartment;


import com.LA_houseLease.app.service.ApartmentInfoService;
import com.LA_houseLease.app.vo.apartment.ApartmentDetailVo;
import com.LA_houseLease.common.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin(origins = "*")
@Slf4j
@RestController
@Tag(name = "公寓信息")
@RequestMapping("/app/apartment")
public class ApartmentController {

    @Autowired
    private ApartmentInfoService apartmentInfoService;
    @Operation(summary = "根据id获取公寓信息")
    @GetMapping("getDetailById")
    public Result<ApartmentDetailVo> getDetailById(@RequestParam Long id) {
        log.warn("根据id获取公寓信息--ApartmentController.getDetailById");
        ApartmentDetailVo apartmentDetailVo=apartmentInfoService.getDetailById(id);
        return Result.ok(apartmentDetailVo);
    }
}
